package com.hu.video.entity.dto;

import com.fasterxml.jackson.annotation.JsonFormat;

import java.math.BigDecimal;
import java.util.Date;

public class VideoHotRankDTO {
    private Long videoId;
    private String videoTitle;
    private String videoInfo;
    private String thunmbnailUrl;
    private String videoUrl;
    
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    private Date editDate;
    
    private Integer rankPosition;
    private BigDecimal hotScore;
    private Long viewCount;
    private Long likeCount;
    private Long commentCount;
    private Long shareCount;
    private Long collectCount;
    private String trend;
    private Integer positionChange;
    private BigDecimal growthRate;
    
    // UP主信息
    private Long userId;
    private String userName;
    private String userIconUrl;
    
    // 视频分类
    private Long videoTypeId;
    private String typeName;
    
    // 热度标签
    private String hotTag;
    private String trendIcon;

    public VideoHotRankDTO() {}

    public VideoHotRankDTO(Long videoId, String videoTitle, String thunmbnailUrl, 
                          Integer rankPosition, Long viewCount, Long likeCount, 
                          Long commentCount, String userName) {
        this.videoId = videoId;
        this.videoTitle = videoTitle;
        this.thunmbnailUrl = thunmbnailUrl;
        this.rankPosition = rankPosition;
        this.viewCount = viewCount;
        this.likeCount = likeCount;
        this.commentCount = commentCount;
        this.userName = userName;
    }

    // Getters and Setters
    public Long getVideoId() {
        return videoId;
    }

    public void setVideoId(Long videoId) {
        this.videoId = videoId;
    }

    public String getVideoTitle() {
        return videoTitle;
    }

    public void setVideoTitle(String videoTitle) {
        this.videoTitle = videoTitle;
    }

    public String getVideoInfo() {
        return videoInfo;
    }

    public void setVideoInfo(String videoInfo) {
        this.videoInfo = videoInfo;
    }

    public String getThunmbnailUrl() {
        return thunmbnailUrl;
    }

    public void setThunmbnailUrl(String thunmbnailUrl) {
        this.thunmbnailUrl = thunmbnailUrl;
    }

    public String getVideoUrl() {
        return videoUrl;
    }

    public void setVideoUrl(String videoUrl) {
        this.videoUrl = videoUrl;
    }

    public Date getEditDate() {
        return editDate;
    }

    public void setEditDate(Date editDate) {
        this.editDate = editDate;
    }

    public Integer getRankPosition() {
        return rankPosition;
    }

    public void setRankPosition(Integer rankPosition) {
        this.rankPosition = rankPosition;
    }

    public BigDecimal getHotScore() {
        return hotScore;
    }

    public void setHotScore(BigDecimal hotScore) {
        this.hotScore = hotScore;
    }

    public Long getViewCount() {
        return viewCount;
    }

    public void setViewCount(Long viewCount) {
        this.viewCount = viewCount;
    }

    public Long getLikeCount() {
        return likeCount;
    }

    public void setLikeCount(Long likeCount) {
        this.likeCount = likeCount;
    }

    public Long getCommentCount() {
        return commentCount;
    }

    public void setCommentCount(Long commentCount) {
        this.commentCount = commentCount;
    }

    public Long getShareCount() {
        return shareCount;
    }

    public void setShareCount(Long shareCount) {
        this.shareCount = shareCount;
    }

    public Long getCollectCount() {
        return collectCount;
    }

    public void setCollectCount(Long collectCount) {
        this.collectCount = collectCount;
    }

    public String getTrend() {
        return trend;
    }

    public void setTrend(String trend) {
        this.trend = trend;
    }

    public Integer getPositionChange() {
        return positionChange;
    }

    public void setPositionChange(Integer positionChange) {
        this.positionChange = positionChange;
    }

    public BigDecimal getGrowthRate() {
        return growthRate;
    }

    public void setGrowthRate(BigDecimal growthRate) {
        this.growthRate = growthRate;
    }

    public Long getUserId() {
        return userId;
    }

    public void setUserId(Long userId) {
        this.userId = userId;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public String getUserIconUrl() {
        return userIconUrl;
    }

    public void setUserIconUrl(String userIconUrl) {
        this.userIconUrl = userIconUrl;
    }

    public Long getVideoTypeId() {
        return videoTypeId;
    }

    public void setVideoTypeId(Long videoTypeId) {
        this.videoTypeId = videoTypeId;
    }

    public String getTypeName() {
        return typeName;
    }

    public void setTypeName(String typeName) {
        this.typeName = typeName;
    }

    public String getHotTag() {
        return hotTag;
    }

    public void setHotTag(String hotTag) {
        this.hotTag = hotTag;
    }

    public String getTrendIcon() {
        return trendIcon;
    }

    public void setTrendIcon(String trendIcon) {
        this.trendIcon = trendIcon;
    }

    // 格式化播放量显示
    public String getFormattedViewCount() {
        if (viewCount == null) return "0";
        if (viewCount >= 10000) {
            return String.format("%.1f万", viewCount / 10000.0);
        }
        return String.valueOf(viewCount);
    }

    // 格式化点赞数显示
    public String getFormattedLikeCount() {
        if (likeCount == null) return "0";
        if (likeCount >= 10000) {
            return String.format("%.1f万", likeCount / 10000.0);
        }
        return String.valueOf(likeCount);
    }

    // 格式化评论数显示
    public String getFormattedCommentCount() {
        if (commentCount == null) return "0";
        if (commentCount >= 10000) {
            return String.format("%.1f万", commentCount / 10000.0);
        }
        return String.valueOf(commentCount);
    }

    @Override
    public String toString() {
        return "VideoHotRankDTO{" +
                "videoId=" + videoId +
                ", videoTitle='" + videoTitle + '\'' +
                ", rankPosition=" + rankPosition +
                ", viewCount=" + viewCount +
                ", likeCount=" + likeCount +
                ", commentCount=" + commentCount +
                ", userName='" + userName + '\'' +
                '}';
    }
} 